treeview: Don't react to clicks on cell editables
authorMatthias Clasen <mclasen@redhat.com>
Mon, 3 Aug 2020 11:49:31 +0000 (07:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 3 Aug 2020 11:51:09 +0000 (07:51 -0400)
We need to let these pass through, otherwise we
interfere with the entries that are used for editing.

Fixes: #3008
gtk/gtktreeview.c

index 5391b781721c30234fc0435031df601ae0b94fea..0898adea77ba09c7d4bfd5389efe5498412b2193 100644 (file)
@@ -2764,6 +2764,12 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
   guint button;
   GList *list;
   gboolean rtl;
+  GtkWidget *target;
+
+  /* check if this is a click in an editing widget */
+  target = gtk_event_controller_get_target (GTK_EVENT_CONTROLLER (gesture));
+  if (priv->edited_column && gtk_widget_is_ancestor (target, widget))
+    return;
 
   gtk_tree_view_stop_editing (tree_view, FALSE);
   button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));